<?php if($result){
 echo '<div id="stfbwall_container" class="st_container">';
    foreach($result as $k => $post) {
         if( $k >= $offset){
           $avatar = file_get_contents("http://graph.facebook.com/{$post['actor_id']}/picture");
         echo '  <div class="container_message">
                <a target="_blank" href="http://www.facebook.com/profile.php?id='.$post['actor_id'].'">
                    <img src="'.$users[$post['actor_id']]['pic_square'].'" alt="" >
                </a>
                <div class="fb_message">
                    <a target="_blank" href="http://www.facebook.com/profile.php?id='.$post['actor_id'].'">
                        <span class="actor_name">'.$users[$post['actor_id']]['name'].'</span>
                    </a>
                    <span>
                        '.$post['message'].'
                    </span>
                    <br clear="both"/>
                    <p>
                        <i></i>
                        '.date('d-m-Y',$post['created_time']).'
                        <a target="_blank" href="'.$post['permalink'].'">
                            <span> Detail</span>
                        </a>
                    </p>
                </div>
            </div>
    <br clear="both" />';
        }
 }
 echo '</div>
<br clear="both" />';
 }?>